import 'package:flutter/material.dart';

class ImageDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("图片和ICON"),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            new Text("加载本地图片"),
            Image(image: new AssetImage("assets/images/image4.jpg"),width: 200.0,),
            new Text("Flutter提供快捷构造加载本地图片方法"),
            Image.asset("assets/images/image4.jpg",width: 200.0),
            new Text("加载网络图片"),
            Image(
                image: NetworkImage(
                    "http://bj.bcebos.com/ps-scholar/xueshu/1582270717/20389/3500c6d8ebbed3e4706868039b6b0f4c.jpg"),width: 200.0),
            new Text("Flutter提供快捷构造加载网络图片方法"),
            Image.network(
              "http://bj.bcebos.com/ps-scholar/xueshu/1582270717/20389/3500c6d8ebbed3e4706868039b6b0f4c.jpg",
              width: 200.0,
            ),
          ],
        ),
      ),
    );
  }
}
